/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package growth.net.peer;

/**
 *
 * @author ravi
 */
class Message {

    public static final int INFINITE = -1;
    public String id = null;
    public String body = null;
    public String sourceid = null;
    public int timeToLive = -1;

    public static Message createMessage(String[] partsOfMsg) {
        Message msg = new Message();
        msg.sourceid = partsOfMsg[1];
        msg.id = partsOfMsg[2];
        msg.body = partsOfMsg[3];
        msg.timeToLive = Integer.valueOf(partsOfMsg[4]);
        return msg;
    }

    public Message() {
    }
}
